Repository navigation
fix(gen): sort merged required lists so stable/9 generation is deterministic - #457
Merged
Merged
Conversation
…inistic SpecFlattener emitted a set in hash order, so every regeneration reordered required: in generated/bundled_spec.yaml. main and stable/10 already sort it (5b7e186). This is a prerequisite for backports that regenerate on stable/9.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change to make merged required-field ordering deterministic.
No open issues 🎉
What changed in this PR
Makes SDK generation deterministic on stable/9 by sorting merged required lists, preparing the branch for target-branch regeneration in the backport workflow described in #375.
Changes:
- Sort merged
allOfrequired fields instead of relying on set iteration order. - Add a regression test that checks the merged list is sorted.
- Refresh the bundled specification with ordering-only changes; generated Python remains unchanged.
| File | Description |
|---|---|
tests/unit/test_patch_bundled_spec_determinism.py |
Adds regression coverage for sorted merged required fields. |
hooks/pre_gen/0100_patch_bundled_spec.py |
Makes merged required-field ordering deterministic. |
generated/bundled_spec.yaml |
Updates required lists to the deterministic order. |
Review effort: Balanced
This was referenced Nov 15, 2026
…rministic-required # Conflicts: # generated/bundled_spec.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisite for #375 (backports that regenerate on the target branch).
On stable/9,
hooks/pre_gen/0100_patch_bundled_spec.pywrote the allOf flattener's mergedrequiredaslist(set), so its order depended onPYTHONHASHSEED. Each regeneration reshuffledrequired:ingenerated/bundled_spec.yaml. I confirmed this by generating twice with seeds 1 and 2. main and stable/10 already sort it (5b7e186). This ports that exact change.Commits (generator change separate from regenerated output):
fix(gen): the hook change, plustests/unit/test_patch_bundled_spec_determinism.py(red before, green after).chore(gen): regenerated output. Onlygenerated/bundled_spec.yamlchanges (requiredorder, 56 lines). The generated Python is unchanged. With the fix, seeds 1 and 2 give byte-identical output.Checks:
pytest tests/unit81 passed; ruff and pyright are clean on the changed files.